We will now take a look at the generalization of local languages. Like before, this regard of two-dimensional languages is based on the theory of string languages. The one-dimensional case has two important generalizations: locally testable languages and locally threshold testable languages. We will extend these notions to two dimensions based on the research of~\cite{giammarresi1997twodimensional}. 

At first, we define an equivalence relation on pictures over $\Sigma^{*, *}$. Let $h,k \geq 1$ be two integers. The equivalence relation $\sim_{h, k}$ on $\Sigma^{*, *}$ is defined as follows: \[p \sim_{h, k} q \Leftrightarrow B_{h, k}(\hat{p}) = B_{h, k}(\hat{q}), \forall p, q \in \Sigma^{*, *}\]

That means, two pictures are $\sim_{h, k}$-equivalent, iff the corresponding bordered pictures have the same sub-pictures of size $(h, k)$. 

\begin{definition}
	Let $L \subseteq \Sigma^{*, *}$ be a two-dimensional language. L is called \emph{locally testable}, if it is the union of $\sim_{h, k}$-equivalence classes for some h and k. 
\end{definition}

The family of locally testable pictures is denoted as LT. 

As a further generalization, we want to limit the occurrences of sub-pictures. Let $p \in \Sigma^{*, *}$ be a picture, $t \geq 1$ be a \emph{threshold number} and $h, k \geq 1$ be two integers. For any picture $\sigma$ of size $(h, k)$ we define $occ_\sigma^t(p)$ to be the number of occurrences of $\sigma$ in $\hat{p}$, if $\sigma$ occurs in $p$ less than t times,  $occ_\sigma^t(p)$ is t otherwise. 

This gives us another equivalence relation: \[p \sim_{h, k}^t q \Leftrightarrow occ_\sigma^t(p) = occ_\sigma^t(q), \forall p, q \in \Sigma^{*, *} \text{ and } \forall \sigma \in \Sigma^{h, k}\]

\begin{definition}
	Let $L \subset \Sigma^{*, *}$ be a two-dimensional language. L is called \emph{locally threshold testable}, if it is the union of $\sim_{h, k}^t$-equivalence classes for some h, k and t. 
\end{definition}

The family of locally threshold testable languages is denoted as LTT. Note that the class of locally testable languages is a special case of locally threshold testable languages when $t = 1$. 

It can be shown, that any language in LTT is a projection of a language in LT~\cite{giammarresi1997twodimensional}. Furthermore, the following theorem holds: 

\begin{theorem}
	$LT \subset LTT \subset \familyOf{TS}$
\end{theorem}